package com.kang.hello;

import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Component  //持久化   非独占     不是自动删除的队列
@RabbitListener(queuesToDeclare = @Queue(value = "hello", declare = "true", autoDelete = "true"))
public class HelloCustomer {

    @RabbitHandler
    public void receive(String msg) {
        System.out.println("msg = " + msg);
    }
}
